home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 51 / Amiga Format CD51 (2000-03-10)(Future Publishing)(GB)[!][issue 2000-04].iso / -in_the_mag- / freedos / freedos_docs / mini / emacs-customize.txt next >
Text File  |  2000-02-08  |  4KB  |  82 lines

  1. The following was written by Ken R. van Wyck, and is reproduced here by
  2. permission.
  3.  
  4.  
  5.  
  6.  
  7.  
  8. The following is a *very* brief tutorial on modifying FREEMACS - it may
  9. be of some value to FREEMACS users.
  10.  
  11. Any FREEMACS function (they're called STRINGs in some docs) may be edited
  12. using the "ef" function.  Ef, logically enough, stands for edit function.
  13. Additionally, new functions may be added to any library of functions
  14. using ef.  To invoke ef to edit, for example, a function called
  15. my-function, type:  M-x ef  <CR>.  You will then be prompted for a
  16. function name, enter: my-function <CR>.  FREEMACS will then open an EDIT
  17. buffer (or append to an existing one) the ASCII source code to that
  18. function if it exists.  You may edit that function as you edit any text.
  19.  
  20. Before I continue, a word on libraries.  A FREEMACS library is a
  21. collection of these functions, stored in one common file.  By default,
  22. FREEMACS loads three libraries.  They are:  EMACS.ED (the main, or
  23. Fundamental library), KEYS.ED (a library containing all of the key
  24. bindings), and USER.ED (a library containing code installed by you).
  25. Each library has associated with it a library letter.  EMACS.ED is
  26. known as F for fundamental, USER.ED is U, and KEYS.ED is K.  All
  27. function names are preceeded by the name of the library that they're
  28. in.  Also, if the function is user-callable, the library name is
  29. followed by a ":".  For example, the ef function is stored in the
  30. MINTED library (M), so the full name of the ef function is "M:ef".
  31. When you use ef to edit a function, you can explicitly define which
  32. library the function you want to edit is in by giving its full name,
  33. or you can just say, for example, my-function as the function name.
  34. Ef would then search ALL the loaded libraries for any function that
  35. begins with "my-function".
  36.  
  37. The best place to put your code is in the USER (U) library.  New
  38. versions of Freemacs will always be delivered with an empty USER library.
  39.  
  40. Ok, getting back to editing my-function.  Once you've edited the
  41. function to your satisfaction, type: C-c C-c.  This runs the function
  42. M-x done-editing.  This causes FREEMACS to read in all the new
  43. function definitions.  You could then test your function(s) and, if
  44. they're ok, type: M-x save-all-libs.  This would save all modified
  45. libraries.  The next time you load FREEMACS, your modified function(s)
  46. will be available.
  47.  
  48.  
  49. In the function F&setup, the default libraries are loaded and some variables
  50. are defined.  In addition, the files mentioned on the command line are
  51. loaded.
  52.  
  53. The KEYS.ED library, as mentioned contains all your key bindings.
  54. There are two ways to edit key bindings.  One is to use the functions
  55. keys-edit and keys-read as per the FREEMACS documentation.  An
  56. alternative, and perhaps better, method is to use ef and actually edit
  57. the functions themselves.  For example, I may want to edit one of my
  58. M- definitions.  I may want to load all my M- keys (for reference,
  59. etc.).  So, I would type: M-x ef <CR>.  Then, use K.M- <CR> as the
  60. name of the function.  (Note that the key binding functions are
  61. preceeded by "K.", not "K:".)  FREEMACS would then load all the
  62. functions which begin with K.M- which, in this case, is all of my M-
  63. key bindings.  I could then edit any existing functions and add any
  64. new ones.  When done, save the library as you would save any library
  65. (see above).  A distinct advantage of doing it this way is that you
  66. can bind keys to functions outside of the Fundamental library.  For
  67. example, I wanted to bind a couple of keys to functions in my User
  68. library.  Here is an example key binding function:
  69.  
  70. Name:K.M-l
  71. [*]U:lowercase-word[*]
  72.  
  73. The key that is bound in this function is M-l, and it is bound to the
  74. function U:lowercase-word.  The function definition is enclosed between
  75. the [*]'s and may be on more than one line.  This, by the way, is the
  76. structure of ALL FREEMACS functions.
  77.  
  78. Kenneth R. van Wyk
  79. User Services
  80. Lehigh University Computing Center
  81. April 21, 1987
  82.